<?php session_start();
$captcha = imagecreate(130, 32);
$bg = imagecolorallocate($captcha, 0, 0, 0);
$font_color = imagecolorallocate($captcha, 255, 255, 255);
$font = "font/UTM-Avo.ttf";
$string = md5(microtime() * time());
$text = substr($string, 0, 7);
$_SESSION['security_code'] = $text;
imagettftext($captcha, 20, 0, 5, 25, $font_color, $font, $text);
header("content-type: image/png");
imagepng($captcha);
imagedestroy($captcha);
?>